import Vue from "vue";
import VueRouter from "vue-router";
//导入页面组件
import login from "../views/login/index.vue";
import layout from "@/views/layout";
import my from "@/views/my";
import qa from "@/views/qa";
import video from "@/views/video";
import home from "@/views/home";

Vue.use(VueRouter);

const routes = [{
        path: "/login",
        component: login,
    },
    {
        path: "/",
        component: layout,
        children: [{
                path: "",
                component: home,
            },
            {
                path: "/qa",
                component: qa,
            },
            {
                path: "/my",
                component: my,
            },
            {
                path: "/video",
                component: video,
            },
        ],
    },
];

const router = new VueRouter({
    routes,
});

export default router; /*  */